package org.example5;

/** 当断点停在26行,通过jstack命令查看main线程的调用链,可以看到
      org.example5.Foo$Bar.access$200(Foo.java:5)这里有合成方法

     "main" #1 prio=5 os_prio=0 tid=0x0000000003722800 nid=0x88f4 at breakpoint[0x00000000034de000]
     java.lang.Thread.State: RUNNABLE
     at org.example5.Foo$Bar.show(Foo.java:26)
     at org.example5.Foo$Bar.access$100(Foo.java:18)
     at org.example5.Foo.main(Foo.java:31)

     Locked ownable synchronizers:
     - None

 */
public class Foo {
    private final String field1 = "Hello";
    private class Bar {
        private Bar() {
            System.out.println(field1);
        }

        private void show() {
            System.out.println(field1 +" world");
            System.out.println(1/1);
        } //断点停在这里,可以通过jstack命令查看main线程的调用链
    }

    public static void main(String[] args) {
        Foo.Bar bar = new Foo().new Bar();
        bar.show();
    }
}